<html>

<head>
<title>The Flip Game</title>
</head>

<body>

<center>
<h1>BOI 99 Day 1 Problem 2</h1>
<h1>The Flip Game</h1>
</center>

<p>
There is an ancient solitaire game named &quot;the flip game&quot;. It consists of an
array of M rows and 9 columns of two-colored pegs, with a black and a white side. When a
peg with its white side showing is flipped, it shows its black side, and the other way
around.
<p>
In each move of the game the player flips an entire row or an entire column.
<p>
The objective of the game is to leave as few pegs on their black side on the board as
possible, by doing any number of moves.

<h2>Input</h2>
Your program should read the input from the file INPUT.TXT. The first line contains one
positive integer number M (1 &lt;= M &lt;= 1000), denoting the number of rows in the game
board. The next M consecutive lines contain exactly 9 characters, which are &quot;0&quot;s
or &quot;1&quot;s, separated by one space character, where &quot;0&quot; means a peg
showing its white side and &quot;1&quot; means a peg showing its black side.

<h2>Output</h2>
Your program should produce its output into the file OUTPUT.TXT as follows:<br>
There will be only one line of text, containing the minimum possible number of pegs
showing their black side, which are left on the game board.

<h2>Sample Input</h2>
<pre>
4
1 1 1 1 1 1 1 1 1
1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0
</pre>

<h2>Sample Output</h2>
<pre>
1
</pre>

<h2>Remark</h2>
Time Limit per test: 3 seconds<br>

</body>
</html>
